import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function queryMenuTree(params: object) {
  return http.request<HttpResult>("get", "/admin/menu/get/tree", {
    params: params
  });
}

export function updateMenu(params) {
  return http.request<HttpResult>("post", "/admin/menu/update", {
    data: params
  });
}

export function addMenu(params) {
  return http.request<HttpResult>("post", "/admin/menu/insert", {
    data: params
  });
}

export function deleteMenu(ids) {
  return http.request<HttpResult>("post", `/admin/menu/delete/${ids}`);
}

export function queryValid(data) {
  return http.request<HttpResult>("get", "/admin/menu/get/exists", {
    params: data
  });
}
